import request from '@/utils/request'

/**
 * @description：获取组织架构数据
 * @returns
 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
* @description:获取员工简单列表
* @param {*}
* @return {*}
*/

export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * @description 获取部门
 * @param {*} data
 * @returns
 */

export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data

  })
}
/**
 * @description 根据ID查询部门详情
 * @param {*} id
 * @returns
 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * @description 根据ID修改部门详情
 * @param {*} data
 * @returns
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
